Remove unnecessary parentheses from bind.md example#4363
Remove unnecessary parentheses from bind.md example#4363calebporzio merged 1 commit intoalpinejs:mainfrom
Conversation
|
I think it's fine as is, and probably more accurate. |
|
@browner12 I agree with your reasoning. How do you think Alpine's docs can help beginners like me understand that there's no difference between |
|
is kind of less of an Alpine question, and more of a JS question. Alpine does do some magic that allows you to omit the parentheses, and you're kind of not technically writing Javascript in the attribute, but IMO I treat it as valid Javascript, which is why I always use the parentheses. consistency would be nice, and I would personally lean towards using the parentheses, but that's something a maintainer will have to decide. |
|
To clarify on the difference, if the function is nested in an object, and accesses |
When I saw this example using
x-data="dropdown()"and other examples usingx-data="dropdown"I wondered what caused this example to require parentheses. It seems like adding parentheses is redundant since the example code works both with and without them.